const url = "https://restapi.amap.com/v3/geocode/geo?";
const reversUrl = "https://restapi.amap.com/v3/geocode/regeo?";
// const key = "eccfdb3c11ffb4f6615fce6d50682399";
// 申请 Web 服务 API 类型 Key
const key = "3d397e27fd6c54498c38ea5290326dfa";
export const ossUrl = "http://qwzls.oss-cn-hangzhou.aliyuncs.com/recruit/static/message/faces/";

export const emojis = {
  path: ossUrl,
  items: {
    "[):]": "ee_1.png",
    "[:D]": "ee_2.png",
    "[;)]": "ee_3.png",
    "[:-o]": "ee_4.png",
    "[:p]": "ee_5.png",
    "[(H)]": "ee_6.png",
    "[:@]": "ee_7.png",
    "[:s]": "ee_8.png",
    "[:$]": "ee_9.png",
    "[:(]": "ee_10.png",
    "[:'(]": "ee_11.png",
    "[<o)]": "ee_12.png",
    "[(a)]": "ee_13.png",
    "[8o|]": "ee_14.png",
    "[8-|]": "ee_15.png",
    "[+o(]": "ee_16.png",
    "[|-)]": "ee_17.png",
    "[:|]": "ee_18.png",
    "[*-)]": "ee_19.png",
    "[:-#]": "ee_20.png",
    "[^o)]": "ee_21.png",
    "[:-*]": "ee_22.png",
    "[8-)]": "ee_23.png",
    "[del]": "btn_del.png",
    "[(|)]": "ee_24.png",
    "[(u)]": "ee_25.png",
    "[(S)]": "ee_26.png",
    "[(*)]": "ee_27.png",
    "[(#)]": "ee_28.png",
    "[(R)]": "ee_29.png",
    "[({)]": "ee_30.png",
    "[(})]": "ee_31.png",
    "[(k)]": "ee_32.png",
    "[(F)]": "ee_33.png",
    "[(W)]": "ee_34.png",
    "[(D)]": "ee_35.png"
  }
};

export const getCoordFromAddress = (address: string) => {
  // return http.get<any>(url, {
  //     address,
  //     key
  // });
  return fetch(`${url}address=${address}&key=${key}`);
};

export const getAddressFromCoord = (coord: string) => {
  // console.log(coord);
  return fetch(`${reversUrl}location=${coord}&key=${key}`);
};
